package com.fourth.controller;

import com.fourth.service.UBbusinessInfoService;
import com.fourth.service.UBuserInfoService;
import com.ljx.entity.BusinessInfo;
import com.ljx.entity.UserInfo;
import com.ljx.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * @author C-Q
 * @version 1.1.0
 * @Description: 用户信息
 * @date 2023/3/2
 */
@RestController
@RequestMapping("/merchant")
public class UBbusinessInfoController {


    @Autowired(required = false)
    private UBuserInfoService ubUserInfoService;

    @Autowired(required = false)
    private UBbusinessInfoService uBbusinessInfoService;
    /**
     * 根据当前用户名查询商家信息
     * @return
     */
    @RequestMapping("BusinessAll")
    public Result BusinessAll(){
        return ubUserInfoService.UserOrBusinessInfo();
    }

    /**
     * 根据当前用户名查询修改商家信息
     * @return
     */
    @RequestMapping("BusUpdate")
    public Result BusUpdate(@RequestBody BusinessInfo businessInfo) {
        return uBbusinessInfoService.BusRevise(businessInfo);

    }
}
